﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DataTier
{

    public class Reservation
    {

        private int _reservationNr;
        private IList<PartReservation> _partReservations;
        private Customer _customer;

        public Reservation()
        {
            _partReservations = new List<PartReservation>();
        }

        public Reservation(int reservationNr)
        {
            _reservationNr = reservationNr;
            _partReservations = new List<PartReservation>();
        }

        public void AddPartReservation(Station station)
        {

            DateTime pickUpDate = DateTime.Now.AddHours(_partReservations.Count);
            _partReservations.Add(new PartReservation(pickUpDate, pickUpDate.AddDays(1), station));


        }

        public int ReservationNr
        {
            get { return _reservationNr; }
            set { _reservationNr = value; }
        }

        public IList<PartReservation> PartReservations
        {
            get { return _partReservations; }
            set { _partReservations = value; }
        }

        public Customer Customer
        {
            get { return _customer; }
            set { _customer = value; }
        }

        public override string ToString()
        {
            return _reservationNr.ToString();
        }

    }

}
